import service
import GameWorld
import zaction
import blue

class EntityProcSvc(service.Service):
    __guid__ = 'svc.entityProcSvc'
    __machoresolve__ = 'location'

    def Run(self, *args):
        service.Service.Run(self, *args)
        GameWorld.RegisterPythonActionProc('SetEntityPosition', self._SetEntityPosition, ('ENTID', 'ALIGN_POSITION', 'ALIGN_ROTATION'))



    def _SetEntityPosition(self, ENTID, ALIGN_POSITION, ALIGN_ROTATION):
        entity = self.entityService.FindEntityByID(ENTID)
        if (entity is not None):
            positionComponent = entity.GetComponent('position')
            if (positionComponent is not None):
                positionComponent.rotation = ALIGN_ROTATION
                positionComponent.position = ALIGN_POSITION



exports = {'actionProcTypes.SetEntityPosition': zaction.ProcTypeDef(isMaster=True, procCategory='Entity')}

